Creating image checkpoints

Image checkpoints verify that an image in an application matches an expected image. For example, you can verify that a logo on a web page is in the correct location.

Image checkpoints use a test area in the screenshot captured for the action performed in the previous statement as the expected image. If the test area in the application does not match the expected image within a minimum percentage of accuracy, the checkpoint fails.

1. Select the script line above where to add the statement. You must select a statement that performs an action in the application.

2. Choose Script > Add Statement.

The Add Statement dialog box opens.

3. Select Checkpoint Image in the Checkpoint category.

4. The Application/version field is automatically set with the context. This information is used to populate the Window and Control fields on the Add Statement dialog box with values from the application repository. See Script.SetContext.

If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you add statements to a utility script that is only called by other scripts because the context is set in the script that calls it. If an application/version is required, select it from the list.

5. Click the Actual screenshot and drag the red rectangle to select the area to check or enter the Test Area information to specify the area to verify.

The Test Area fields are automatically populated based on the location and size of the rectangle relative to the actual screenshot captured from the previous statement.

Note: If the screenshot does not include the image you need to check, run the script before adding the checkpoint.

6. Click Save As Expected to save the actual image as the expected image to compare with the application during playback.

The Save Image File As dialog box opens.

7. Choose a location to save the file in and enter a File name.

8. Click Save.

The expected image is saved.

9. Enter the minimum percentage of Accuracy between the actual and expected image required to pass the checkpoint.

The actual and expected images may not match exactly. For example, if the minimum percentage of accuracy is 80% and the accuracy calculated during playback is 85%, the checkpoint passes without requiring an exact match. The default accuracy is 100%.

Note: If you click Test before adding the statement, the actual and expected image always match because the expected image is the same as the image in the application repository. If a checkpoint fails during playback, you can edit it and click Test to compare the expected image against the actual image captured when the script ran. This can help you determine if changes are needed to the expected image or minimum accuracy percentage. See Editing image checkpoints.

10. Expand the Advanced options to indicate what happens if the checkpoint fails.

11. Enter an optional Comment, such as the purpose of the statement.

12. Click OK to add the statement to the script.